docs: Fix the GtkVolumeButton gallery image
authorMatthias Clasen <mclasen@redhat.com>
Mon, 26 Oct 2020 02:42:40 +0000 (22:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 26 Oct 2020 02:42:40 +0000 (22:42 -0400)
Give up on showing the popup, we don't do that
for other buttons either.

docs/reference/gtk/images/volumebutton.png
docs/tools/widgets.c

index b310451235882e761cc3bd68740948b0355b75ab..ff484bd1581daa12cb5ee5f1b4b867594c09e611 100644 (file)
Binary files a/docs/reference/gtk/images/volumebutton.png and b/docs/reference/gtk/images/volumebutton.png differ
index 04c6882140901eb3032f3c44322a2b2d7cc81f05..5d83a0df79c91284af80dc6826650456aaa957f5 100644 (file)
@@ -1170,25 +1170,18 @@ create_spinner (void)
 static WidgetInfo *
 create_volume_button (void)
 {
-  GtkWidget *button, *box;
-  GtkWidget *widget;
-  GtkWidget *popup;
-
-  widget = gtk_window_new ();
-  gtk_widget_set_size_request (widget, 100, 250);
-
-  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-  gtk_window_set_child (GTK_WINDOW (widget), box);
+  GtkWidget *widget, *vbox;
 
-  button = gtk_volume_button_new ();
-  gtk_box_append (GTK_BOX (box), button);
+  widget = gtk_volume_button_new ();
+  gtk_scale_button_set_value (GTK_SCALE_BUTTON (widget), 33);
 
-  gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33);
-  popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (button));
-  gtk_widget_realize (widget);
-  gtk_widget_show (popup);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
+  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Volume Button"));
 
-  return new_widget_info ("volumebutton", widget, ASIS);
+  return new_widget_info ("volumebutton", vbox, SMALL);
 }
 
 static WidgetInfo *